function [r] = rq(P,v)
u = P'*v;
r = (u'*u)/(v'*v);
end